CREATE PROCEDURE coreWFTaskExitPathsDeleteByTaskingID
(
	@id	int
)
AS

	DECLARE @EPID int;
	DECLARE csr_ExitPaths CURSOR FOR
		SELECT PK_ID FROM WFTaskExitPaths WHERE FK_TaskingID=@id;
		
	OPEN csr_ExitPaths;
	FETCH NEXT FROM csr_ExitPaths INTO @EPID;
	
	WHILE @@FETCH_STATUS = 0
	BEGIN
		EXEC coreWFTaskExitPathsDeleteByID @EPID;
		FETCH NEXT FROM csr_ExitPaths INTO @EPID;
	END
	
	CLOSE csr_ExitPaths;
	DEALLOCATE csr_ExitPaths;
